package Document;


import java.sql.*;

public class DAO {
	
	private String driver;
	private String chaineConnexion = "jdbc:mysql://localhost:3306/document";
	private String login = "root";
	private String password = "";
	private Connection connexion;
	
	public String getDriver() {
		return driver;
	}
	public void setDriver(String driver) {
		this.driver = driver;
	}
	public String getChaineConnexion() {
		return chaineConnexion;
	}
	public void setChaineConnexion(String chaineConnexion) {
		this.chaineConnexion = chaineConnexion;
	}
	public String getLogin() {
		return login;
	}
	public void setLogin(String login) {
		this.login = login;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public Connection getConnexion() throws ClassNotFoundException, SQLException {
		Class.forName(driver);
		return  DriverManager.getConnection(this.chaineConnexion,this.login,this.password);
	}
	public void setConnexion(Connection connexion) {
		this.connexion = connexion;
	}
  
}
